import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 商品信息
 */
@Entity('order_goods')
export class OrderGoodsEntity extends BaseEntity {
  @Column({ comment: '商品名称' })
  goodsName: string;

  @Column({ comment: '商品单价', type: 'decimal', precision: 10, scale: 2 })
  goodsPrice: number;

  @Column({ comment: '商品图片', nullable: true })
  goodsPic: string;

  @Column({ comment: '商品详情图', nullable: true })
  goodsDetailPic: string;

  @Column({ comment: '商品描述', nullable: true, type: 'text' })
  goodsDescription: string;

  @Column({ comment: '关联商品id', nullable: true })
  relatedGoodsId: number;

  @Column({ comment: '商品类型（单眼，双眼）', nullable: true })
  eyeType: number;

  @Column({ comment: '镜片膜列表', type: 'json', nullable: true })
  switchList: any[];

  @Column({ comment: '逻辑删除', default: false })
  isDeleted: boolean;

  @Column({ comment: '镜片限制', type: 'json', nullable: true })
  lensData: {
    ballLimit: any[];
    poleLimit: any[];
    ballDegrees: any[];
    poleDegrees: any[];
  };
}
